<%@page import="java.util.ArrayList"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" import="com.miracle.myfav.base.*,java.sql.*,java.util.*,com.miracle.myfav.entity.*"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>我的收藏</title>
</head>
<body>
<%
	Connection conn = DBPool.getInstance().getConnection();
	PreparedStatement pstmt = null;
	ResultSet rs = null;
	String sql ="select * from site";
	List<Site> ls = new ArrayList<Site>();
	try{
		pstmt= conn.prepareStatement(sql);
		rs = pstmt.executeQuery();
		while(rs.next()){
			Site site = new Site();
			site.setId(rs.getInt("id"));
			site.setSname(rs.getString("sname"));
			site.setSurl(rs.getString("surl"));
			site.setSpropid(rs.getString("spropid"));
			site.setSdesc(rs.getString("sdesc"));
			ls.add(site);
		}
	}catch(SQLException e){
		e.printStackTrace();
	}finally{
		DBPool.getInstance().close(pstmt, rs, conn);
	}
%>
<center>
<table border="1">

	<%for(Site s: ls){ %>
	<tr>
		<td><%=s.getSname() %></td><td><a href="<%=s.getSurl()%>"><%=s.getSurl() %></a></td><td><%=s.getSdesc() %></td>
	</tr>
	<%} %>
</table>
</center>
</body>
</html>